<!DOCTYPE html>
<html>
<head>
    <title>选房进度一览表</title>
<#include "../../common/common.ftl"/>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header">选房进度一览表【<span class="jmdf-color-red">注：点击安置项目名称可查看明细</span>】</div>
        <div class="layui-card-body">
            <button class="layui-btn layui-btn-bg" id="excelBtn"><i
                    class="layui-icon layui-icon-export"></i>导出Excel
            </button>
            <table class="layui-table table" style="text-align: center;">
                <tr class="layui-bg-gray">
                    <th style="text-align: center;" rowspan="2" width="3%">序号</th>
                    <th style="text-align: center;" rowspan="2" width="8%">安置项目名称</th>
                    <th style="text-align: center;" colspan="2">房源签认</th>
                    <th style="text-align: center;">财务复核</th>
                    <th style="text-align: center;">选房签约</th>
                    <th style="text-align: center;" colspan="2">款项结清</th>
                    <th style="text-align: center;">档案发放</th>
                    <th style="text-align: center;" colspan="2">交房情况</th>
                    <th style="text-align: center;" colspan="2">办证情况</th>
                </tr>
                <tr class="layui-bg-gray">
                    <th style="text-align: center;" width="8%">户数</th>
                    <th style="text-align: center;" width="8%">套数</th>
                    <th style="text-align: center;" width="8%">户数</th>
                    <th style="text-align: center;" width="8%">户数</th>
                    <th style="text-align: center;" width="12%">户数【未结清/已结清(款项)/部分结清】</th>
                    <th style="text-align: center;" width="8%">套数【未结清/已结清】</th>
                    <th style="text-align: center;" width="8%">户数</th>
                    <th style="text-align: center;" width="8%">户数</th>
                    <th style="text-align: center;" width="8%">套数</th>
                    <th style="text-align: center;" width="8%">户数</th>
                    <th style="text-align: center;" width="8%">套数</th>
                </tr>
            <#assign index = 0/>
            <#assign allContractChooseHouseStatusCountSum = 0/>
            <#assign allHouseChooseHouseStatusCountSum = 0/>

            <#assign AllContractFinanceCheckStatusCountSum = 0/>
            <#assign allContractAzSignStatusCountSum = 0/>

            <#assign allContractFinanceSettleStatus1CountSum = 0/>
            <#assign allContractFinanceSettleStatus2CountSum = 0/>
            <#assign allContractFinanceSettleStatus2MoneySum = 0/>
            <#assign allContractFinanceSettleStatus3CountSum = 0/>
            <#assign allHouseFinanceSettleStatus1CountSum = 0/>
            <#assign allHouseFinanceSettleStatus2CountSum = 0/>

            <#assign allContractDaffStatusCountSum = 0/>

            <#assign allContractTakeHouseStatusCountSum = 0/>
            <#assign allHouseTakeHouseStatusCountSum = 0/>

            <#assign allContractBzStatusCountSum = 0/>
            <#assign allHouseBzStatusCountSum = 0/>

            <#if azProjectList?size !=0>
                <#list azProjectList as azProject>
                    <#assign contractCountMap = (contractMap[azProject.id?c])!/>
                    <#assign houseCountMap = (houseMap[azProject.id?c])!/>

                    <#assign allContractChooseHouseStatusCountSum = allContractChooseHouseStatusCountSum + (contractCountMap['chooseHouseStatusCount'])!0/>
                    <#assign allHouseChooseHouseStatusCountSum = allHouseChooseHouseStatusCountSum + (houseCountMap['chooseHouseStatusCount'])!0/>
                    <#assign AllContractFinanceCheckStatusCountSum = AllContractFinanceCheckStatusCountSum + (contractCountMap['financeCheckStatusCount'])!0/>
                    <#assign allContractAzSignStatusCountSum = allContractAzSignStatusCountSum + (contractCountMap['azSignStatusCount'])!0/>
                    <#assign allContractFinanceSettleStatus1CountSum = allContractFinanceSettleStatus1CountSum + (contractCountMap['financeSettleStatus1Count'])!0/>
                    <#assign allContractFinanceSettleStatus2CountSum = allContractFinanceSettleStatus2CountSum + (contractCountMap['financeSettleStatus2Count'])!0/>
                    <#assign allContractFinanceSettleStatus2MoneySum = allContractFinanceSettleStatus2MoneySum + (contractCountMap['financeSettleStatus2Money'])!0/>
                    <#assign allContractFinanceSettleStatus3CountSum = allContractFinanceSettleStatus3CountSum + (contractCountMap['financeSettleStatus3Count'])!0/>
                    <#assign allHouseFinanceSettleStatus1CountSum = allHouseFinanceSettleStatus1CountSum + (houseCountMap['financeSettleStatus1Count'])!0/>
                    <#assign allHouseFinanceSettleStatus2CountSum = allHouseFinanceSettleStatus2CountSum + (houseCountMap['financeSettleStatus2Count'])!0/>
                    <#assign allContractDaffStatusCountSum = allContractDaffStatusCountSum + (contractCountMap['daffStatusCount'])!0/>
                    <#assign allContractTakeHouseStatusCountSum = allContractTakeHouseStatusCountSum + (contractCountMap['takeHouseStatusCount'])!0/>
                    <#assign allHouseTakeHouseStatusCountSum = allHouseTakeHouseStatusCountSum + (houseCountMap['takeHouseStatusCount'])!0/>
                    <#assign allContractBzStatusCountSum = allContractBzStatusCountSum + (contractCountMap['bzStatusCount'])!0/>
                    <#assign allHouseBzStatusCountSum = allHouseBzStatusCountSum + (houseCountMap['bzStatusCount'])!0/>
                    <#assign index = index+1 />

                    <tr>
                        <td>${(index)!0}</td>
                        <td>
                            <a href="chooseHouseProgressZsStatistics.ftl?azProjectId=${(azProject.id)!}">${(azProject.projectName)!}</a>
                        </td>
                        <td>${(contractCountMap['chooseHouseStatusCount'])!0}</td>
                        <td>${(houseCountMap['chooseHouseStatusCount'])!0}</td>
                        <td>${(contractCountMap['financeCheckStatusCount'])!0}</td>
                        <td>${(contractCountMap['azSignStatusCount'])!0}</td>
                        <td>
                            【${(contractCountMap['financeSettleStatus1Count'])!0}】/【${(contractCountMap['financeSettleStatus2Count'])!0}(${(contractCountMap['financeSettleStatus2Money'])!0})】/【${(contractCountMap['financeSettleStatus3Count'])!0}】
                        </td>
                        <td>
                            【${(houseCountMap['financeSettleStatus1Count'])!0}】/【${(houseCountMap['financeSettleStatus2Count'])!0}】
                        </td>
                        <td>${(contractCountMap['daffStatusCount'])!0}</td>
                        <td>${(contractCountMap['takeHouseStatusCount'])!0}</td>
                        <td>${(houseCountMap['takeHouseStatusCount'])!0}</td>
                        <td>${(contractCountMap['bzStatusCount'])!0}</td>
                        <td>${(houseCountMap['bzStatusCount'])!0}</td>

                    </tr>
                </#list>
            </#if>
                <tr>
                    <td colspan="2">合计</td>
                    <td>${allContractChooseHouseStatusCountSum}</td>
                    <td>${allHouseChooseHouseStatusCountSum}</td>
                    <td>${AllContractFinanceCheckStatusCountSum}</td>
                    <td>${allContractAzSignStatusCountSum}</td>
                    <td>【${allContractFinanceSettleStatus1CountSum}】/【${allContractFinanceSettleStatus2CountSum}(${allContractFinanceSettleStatus2MoneySum})】/【${allContractFinanceSettleStatus3CountSum}】</td>
                    <td>【${allHouseFinanceSettleStatus1CountSum}】/【${allHouseFinanceSettleStatus2CountSum}】</td>
                    <td>${allContractDaffStatusCountSum}</td>
                    <td>${allContractTakeHouseStatusCountSum}</td>
                    <td>${allHouseTakeHouseStatusCountSum}</td>
                    <td>${allContractBzStatusCountSum}</td>
                    <td>${allHouseBzStatusCountSum}</td>

                </tr>
            </table>
        </div>
    </div>
</div>
<script src="/layui/layui.js" charset="utf-8"></script>
<script src="/plugins/jquery/jquery.min.js" charset="utf-8"></script>
<script src="/plugins/tableExcel/jquery.table2excel.js" charset="utf-8"></script>
<script>
    $("#excelBtn").click(function () {
        $(".table").table2excel({
            exclude: ".noExl",
            name: "安置进度一览表",
            filename: "安置进度一览表",
            exclude_img: true,
            exclude_links: true,
            exclude_inputs: true
        });
    });
</script>
</body>
</html>